<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!-- Metis Menu Plugin JavaScript -->
<script src="${pageContext.request.contextPath}/moban/js/metisMenu.min.js"></script>
<script src="${pageContext.request.contextPath}/moban/js/custom.js"></script>
<!-- Graph JavaScript -->
<script src="${pageContext.request.contextPath}/moban/js/d3.v3.js"></script>
<script src="${pageContext.request.contextPath}/moban/js/rickshaw.js"></script>
<script type="application/x-javascript">
	 addEventListener("load", 
	 		function() { 
	 			setTimeout(hideURLbar, 0); 
	 		}, false);
	 function hideURLbar(){ window.scrollTo(0,1); } 
</script>
<!-- Bootstrap Core JavaScript -->
<script src="${pageContext.request.contextPath}/moban/js/bootstrap.min.js"></script>
<script src="${pageContext.request.contextPath}/arsset/layer/layer.js"></script>
<!-- ----------------主程序代码结束---------------------------------------->
<!-- 消息提示框 组件 调用  mes(内容) 提示对应内容 -->
<script type="text/javascript">
//提示框函数
function mes(content) {
	layer.msg(content);
}
//获得选中的check 数组的值
function loadCheck() {
	var checks = $("input:checked");
	var vals = [];
	for (var i = 0; i < checks.length; i++) {
		if (!checks.eq(i).hasClass('fa_check')) {
			vals.push(checks.eq(i).val());
		}
	}
	return vals;
}
//给所有 页面上的 复选框注册全选，单选事件函数
function checkAll() {
	$("#checkAll").click(function() {
              $('input[name="subBox"]').prop("checked",this.checked); 
          });
          var $subBox = $("input[name='subBox']");
          $subBox.click(function(){
              $("#checkAll").prop("checked",$subBox.length == $("input[name='subBox']:checked").length ? true : false);
          });

}
//删除指定数组指定元素的方法
function removeByValue(arr, val) {
	  for(var i=0; i<arr.length; i++) {
	    if(arr[i] == val) {
	      arr.splice(i, 1);
	      break;
	    }
	  }
	}
/*页面分页方法*/
function paging(total,page,row){
	var pageHtml = "<tr>"
				 + "<td colspan=\""+row+"\" >"
				 + "<nav aria-label=\"Page navigation\">"
				 + "<ul class=\"pagination\">";
	var totalPage= parseInt(total%10==0?total/10:total/10+1);
	if(totalPage == 0){
		pageHtml += "没有查询到数据";	
	}else{
		pageHtml += "<li>"
				 + "<a href=\"javascript:toPage(1);\" aria-label=\"Previous\">"
				 + "<span aria-hidden=\"true\">&laquo;</span>"
				 + "</a>"
				 + "</li>";
		for(var i = page-2;i <= page+2;i++){
			if(i<1||i>totalPage)
				continue;
			if(i==page)
				pageHtml += "<li class=\"active\"><a href=\"javascript:void(0);\">"+i+"<span class=\"sr-only\">(current)</span></a></li>";	
			else
				pageHtml += "<li><a href=\"javascript:toPage("+i+");\">"+i+"</a></li>";	
		}
		pageHtml += "<li>"
				 + "<a href=\"javascript:toPage("+totalPage+");\" aria-label=\"Next\">"
				 + "<span aria-hidden=\"true\">&raquo;</span>"
				 + "</a>"
				 + "</li>";
	}
	pageHtml += "</ul>"+"</nav>"+"</td>"+"</tr>";
	return pageHtml;
}
/*js获取url参数*/
function getQueryString(name) {
	var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
	var r = window.location.search.substr(1).match(reg);
	if (r != null) 
		return unescape(r[2]); 
	return null;
} 
</script>